package com.colt.usercenter;

import com.colt.usercenter.rocketmq.sink.BonusCostSink;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Sink;
import tk.mybatis.spring.annotation.MapperScan;

import java.util.ArrayList;

//扫描mybatis哪些包里面的注解
@MapperScan("com.colt.usercenter.dao")
@SpringBootApplication
@EnableBinding({Sink.class, BonusCostSink.class})
public class UserCenterApplication {

    public static void main(String[] args) {

        SpringApplication.run(UserCenterApplication.class, args);

    }


    public int[] twoSum(int[] nums, int target) {
        ArrayList<Integer> as = new ArrayList<>();

        for(int i = 0;i<=nums.length;i++){
            for (int j = i+1; j < nums.length; j++) {
                if (target == nums[i]+nums[j]){
                    as.add(i);
                    as.add(j);
                    int[] arr1 = as.stream().mapToInt(Integer::valueOf).toArray();
                    return arr1;
                }
            }

        }
        return null;
    }

}
